<template>
	<div>
		<span class="operation" @click="addCondition">
			<a-icon type="filter" />
		</span>
		<span class="operation" @click="copyIndicators(item)">
			<a-icon type="copy" />
		</span>
		<span class="operation" v-if="sum > 1 ? true : false" @click="delIndicators">
			<a-icon type="close" />
		</span>
	</div>
</template>

<script lang="ts">
import { Component, Prop, Emit, Vue } from 'vue-property-decorator'
import { FieldsType } from '../type'

@Component({
	name: 'IndicatorsOperation',
	components: {}
})
export default class extends Vue {
	@Prop() item!: FieldsType //单行指数+条件
	@Prop() itemKey!: number //单行指数+条件
	@Prop() sum!: number

	// 增加条件：index
	@Emit('addCondition')
	private addCondition() {
		return this.itemKey
	}
	// 复制条件：item
	@Emit('copyIndicators')
	private copyIndicators() {
		return this.item
	}
	// 删除
	@Emit('delIndicators')
	private delIndicators() {
		return this.itemKey
	}
}
</script>
<style lang="scss" scoped>
.operation {
	margin-right: 5px !important;
}
</style>
